import { saveDiagram } from "../savaFile/saveXml";
import { setEncoded } from "../savaFile/saveXml";
export function addBpmnListener(downloadLink, bpmnModeler) {
  bpmnModeler.on("commandStack.changed", function() {
    saveDiagram(function(err, xml) {
      setEncoded(downloadLink, "bpmnFile.bpmn", err ? null : xml);
    });
  });
}
